package ControlLayer;
import java.util.ArrayList;
import ModelLayer.ItemCon;
import ModelLayer.Item;
import ModelLayer.*;
/**
 * Write a description of class ItemCtr here.
 * 
 * @author (Gruppe 2) 
 * @version (a version number or a date)
 */
public class ItemCtr
{
    private ItemCon itemCon;
    
    public ItemCtr()
    {
        itemCon = ItemCon.getInstance();
    }
    
    public void getItem(int id)
    {
        itemCon.getItem(id);
    }
    
    public void printItem(int id)
    {
        itemCon.printItem(id);
    }
    
    public void printItemList()
    {
        itemCon.printItemList();
    }
    
    public void createItem(int id, String description, String status, String storage, double price)
    {
        if(itemCon.getItem(id) == null)
        {
            Item newItem = new Item(id, description, status, storage, price);
            itemCon.addItem(newItem);
        }
        else
        {
            System.out.println("There already exists an item with id: "+id+" in the system");
        }
    }
    
    public void removeItem(int id)
    {
        itemCon.removeItem(id);
    }
}
